/*
 * @Author: 高瑞寒 15932717091@163.com
 * @Date: 2022-06-19 09:01:35
 * @LastEditTime: 2022-06-20 00:30:47
 * @LastEditors: 高瑞寒 15932717091@163.com
 * @Description:
 */
const { defineConfig } = require('@vue/cli-service')
const packageName = require('./package.json').name
module.exports = defineConfig({
  publicPath: process.env.NODE_ENV === 'production' ? '/child' : '/child',
  transpileDependencies: true,
  configureWebpack: {
    output: {
      library: `${packageName}`,
      libraryTarget: 'umd',
      chunkLoadingGlobal: `webpackJsonp_${packageName}`
    },
    devServer: {
      // 项目运行时候的端口号
      port: 7000,
      // 关闭主机检查，使微应用可以被 fetch
      historyApiFallback: true,
      allowedHosts: 'all',
      // 配置跨域请求头，解决开发环境的跨域问题
      headers: {
        'Access-Control-Allow-Origin': '*'
      }
    }
  }
})
